<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>归还图书</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/dsb.css">
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand one-pan-link-mark" href="/logout/">退出登陆</a>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class=""><a href="/index" class="one-pan-link-mark">基本信息</a></li>
                <li class=""><a href="/course" class="one-pan-link-mark">选课信息</a></li>
                <li class=""><a href="/mark" class="one-pan-link-mark">成绩信息</a></li>
                <li class=""><a href="/money" class="one-pan-link-mark">消费信息</a></li>
                <li class=""><a href="/book" class="one-pan-link-mark">图书借阅</a></li>
                <li class=""><a href="/all_books/" class="one-pan-link-mark">图书管理</a></li>
                <li class=""><a href="/course_manage" class="one-pan-link-mark">课程管理</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="sub-header">归还图书</h2>
            
            {% if error_message %}
            <div class="alert alert-danger">
                {{ error_message }}
            </div>
            {% endif %}
            
            <div class="panel panel-default">
                <div class="panel-heading">图书信息</div>
                <div class="panel-body">
                    <p><strong>书名：</strong>{{ lend.le_bo.bo_name }}</p>
                    <p><strong>借阅时间：</strong>{{ lend.le_start|date:"Y-m-d H:i" }}</p>
                </div>
            </div>
            
            <form method="post" action="/return_book/{{ lend.le_bo.bo_num }}/">
                <div class="form-group">
                    <label for="return_date">归还日期</label>
                    <input type="date" class="form-control" id="return_date" name="return_date" 
                           min="{{ min_date }}" required>
                    <small class="text-muted">请选择归还日期，必须晚于借阅日期</small>
                </div>
                
                <div class="form-group">
                    <button type="submit" class="btn btn-primary">确认归还</button>
                    <a href="/all_books/" class="btn btn-default">返回</a>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
<script>
    // 获取所有的提示消息
    var alerts = document.querySelectorAll('.alert');
    
    // 为每个提示消息设置3秒后自动隐藏
    alerts.forEach(function(alert) {
        setTimeout(function() {
            alert.style.transition = 'opacity 1s';
            alert.style.opacity = '0';
            setTimeout(function() {
                alert.style.display = 'none';
            }, 1000);
        }, 3000);
    });
</script>
</html> 